CLI Shortcuts
··2 mins
Table of Contents
Configuration #
- Remapping
ctrl
andcaps lock
makes hittingctrl
less of a stretch for the left pinky
Screen manipulation #
ctrl l
- clears the screen and redraws the current line at top of screen (likeclear
command, except you keep your current input)command t
- new tabcommand w
- close tabcommand 1
- switch to tab number 1 (can use any number)command +
- make fonts biggercommand -
- make fonts smaller
Command manipulation #
option arrows
- jump words left and right instead of single charactersoption backspace
- delete an entire word to the left of the cursoroption click
- move cursor to wherever you clickctrl a
- move to the beginning of the linectrl e
- move to the end of the linectrl r
- reverse search historyctrl u
- clear linectrl k
- clear line (after cursor)ctrl y
- insert most recently deleted text at the cursor!!
- (bang bang, or double bang) repeat previous commandsudo !!
- (sudo bang bang) repeat previous command with sudo!100
- (bang 100) re-execute history item #100
Navigation #
cd
- move to home foldercd ~
- (cd home) move to home foldercd -
- (cd minus) move to previous folder
Editing #
ctrl z
- move current app to backgroundfg
- restore app to foreground
References #
- 18 Commands That Will Change The Way You Use Linux Forever | Linode - Lots of great tips here, especially
ctrl+a
andctrl+e
to move to the beginning and end of the current line - Keyboard shortcuts in Terminal on Mac | Terminal User Guide - Official terminal shortcuts